package com.example.administrator.swredeem.activity;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

import com.example.administrator.swredeem.R;
import com.example.administrator.swredeem.net.HttpXutils;

public class OpenCardICActivity extends AppCompatActivity {
    private Intent intent = null;
    private String title = null;
    private EditText huhao,idCard;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_open_card_ic);
        title = getIntent().getStringExtra("title");
        init();
    }


    private void init() {
        huhao = findViewById(R.id.et_huhao);
        idCard = findViewById(R.id.et_idCard);
    }

    public void goUserList(View view) {

        intent = new Intent(OpenCardICActivity.this, UserList.class);
        intent.putExtra("title", title);
        intent.putExtra("huhao",huhao.getText().toString().trim());
        intent.putExtra("idCard",idCard.getText().toString().trim());

        if(!TextUtils.isEmpty(huhao.getText().toString().trim())||!TextUtils.isEmpty(idCard.getText().toString().trim())){
            startActivity(intent);
        }else {
            Toast.makeText(OpenCardICActivity.this,"请输入户号或身份证号",Toast.LENGTH_SHORT).show();
        }


    }

    public void goCard(View view) {
        intent = new Intent(OpenCardICActivity.this, RecognitionCardActivity.class);
        intent.putExtra("title", title);
        startActivity(intent);

    }
}
